Add explicit SSH public key configuration support#348
Add explicit SSH public key configuration support#348sayalibhavsar wants to merge 2 commits intomainfrom
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
80b034f to
fb414d6
Compare
|
The removal of the auto-derivation ( Test Results: https://gist.github.com/sayalibhavsar/236e35ee79ec92b36ef02f71cc497a05 |
PullHero ReviewProvider: generativelanguage.googleapis.com Model: gemini-2.0-flash Okay, I've reviewed the changes. Here's my assessment: OverviewThis PR introduces the ability to specify a separate SSH public key file. Currently, the code assumes the public key is located at AnalysisCode Quality and Maintainability:
Potential Bugs or Security Issues:
Adherence to Project Conventions:
Documentation Completeness:
Specific Feedback:
Vote: -1The code itself is good, however, documentation needs to be updated to reflect the changes. Additionally, it would be better to have a check to make sure the user is providing a valid public key file. Vote: -1 |
|
This relates to RPOPC-492 |
|
Want output from a uperf run; verify this does not break old scenario files, provide output |
Review Summary by QodoAdd explicit SSH public key configuration support across cloud providers
WalkthroughsDescription• Add --ssh_public_key_file CLI option to bin/burden for explicit SSH public key configuration • Introduce ssh_public_key_path Terraform variable across AWS, Azure, and GCP providers • Replace hardcoded public key paths with configurable variable references • Maintain backward compatibility with default ~/.ssh/id_rsa.pub path Diagramflowchart LR
CLI["CLI Option<br/>--ssh_public_key_file"]
BURDEN["bin/burden<br/>Script"]
ANSIBLE["Ansible Variables<br/>ssh_public_key"]
TF["Terraform Variables<br/>ssh_public_key_path"]
CLOUDS["Cloud Providers<br/>AWS/Azure/GCP"]
CLI -->|"Parsed by"| BURDEN
BURDEN -->|"Generates"| ANSIBLE
ANSIBLE -->|"Passed to"| TF
TF -->|"Configures"| CLOUDS
File Changes2. ansible_roles/roles/aws_create/files/tf/vars.tf
|
Code Review by Qodo
1.
|
| if [[ $gl_ssh_key_file == "" ]]; then | ||
| echo " ssh_key: $HOME/.ssh/id_rsa" >> ansible_vars_main.yml | ||
| echo " ssh_public_key: $HOME/.ssh/id_rsa.pub" >> ansible_vars_main.yml | ||
| else |
There was a problem hiding this comment.
1. --ssh_public_key_file ignored 📎 Requirement gap ✓ Correctness
When --ssh_key_file is not provided, the code always writes a default ssh_public_key value and ignores a user-supplied --ssh_public_key_file. This prevents independently specifying the public key and can lead to using the wrong key despite the flag being accepted.
Agent Prompt
## Issue description
`--ssh_public_key_file` is accepted by the CLI but is ignored when `--ssh_key_file` is not set, because `create_ansible_options()` always writes the default `ssh_public_key` in that branch.
## Issue Context
Compliance requires that when users supply both public/private key inputs (and specifically when a public key is supplied), the supplied value is not ignored.
## Fix Focus Areas
- bin/burden[1911-1918]
- bin/burden[3651-3656]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
When --ssh_key_file is provided but --ssh_public_key_file is not, the ssh_public_key variable was never written to ansible_vars_main.yml. This caused the Terraform template (tfvars.j2) to fail with: 'dict object' has no attribute 'ssh_public_key'. Now it defaults to $HOME/.ssh/id_rsa.pub — matching the behavior when no SSH key is specified at all (line 1913). |
PullHero ReviewProvider: generativelanguage.googleapis.com Model: gemini-2.0-flash OK. Here's a review of the changes with a focus on code quality, potential issues, and adherence to project conventions. OverviewThe changes introduce a new Code Quality and Maintainability
Potential Bugs or Security Issues
Adherence to Project Conventions
Documentation Completeness
Suggestions
VoteVote: +1 Vote: +1 |
PullHero ReviewProvider: generativelanguage.googleapis.com Model: gemini-2.0-flash Okay, I've reviewed the proposed changes. The primary goal of this PR seems to be to allow users to explicitly specify the public key file used for SSH authentication, rather than relying on a hardcoded default ( Analysis
Specific Feedback
Recommendations
Vote: -1 Vote: -1 |
Description
Add --ssh_public_key_file CLI option to bin/burden and a ssh_public_key_path Terraform variable across AWS, Azure, and GCP so users can specify public and private SSH keys independently
instead of relying on hardcoded or .pub-derived paths.
Before/After Comparison
Before: Public key hardcoded to ~/.ssh/id_rsa.pub (Azure) or derived by appending .pub to the private key path (GCP); no way to specify a separate public key.
After: New --ssh_public_key_file option and ssh_public_key_path variable let users set the public key path explicitly; defaults to ~/.ssh/id_rsa.pub for backward compatibility.
Documentation Check
No updates needed — optional flag with a backward-compatible default.
Clerical Stuff
This closes #227
Relates to JIRA: RPOPC-492